//
//  Sync.swift
//  YOKO
//
//  Created by 鲁浩 on 16/5/10.
//  Copyright © 2016年 15Tec. All rights reserved.
//

import Foundation
import RealmSwift

class Sync: Object {
    
    // 操作的唯一标识
    dynamic var localId: Int64 = -1
    
    // 数据的唯一标识：
    // event：event的localId
    // calendar就只有localId
    dynamic var dataId: Int64 = -1
    
    dynamic var operationType: Int = -1 // 0: update, 1: delete, 2:insert
    
    // event和calendar对象都要序列化,对于delete操作这个字段是nil
    dynamic var data: String? = nil
    
    dynamic var dataType: Int = -1 // 0: Event 1: Calendar
    
    // 前一次操作的localId,存的是timestamp
    // dynamic var preOperationLocalId: Int64 = 0
    
}
